package com.tgy.dao;

import com.tgy.entity.Department;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/***
 * @ClassName: DepartmentDao
 * @Description:
 * @Auther: 送一一块二向箔
 * @Date: 11:25 2021/12/27
 * @version : V1.0
 */
@Repository
public class DepartmentDao {
    private static Map<Integer, Department> departments = null;
    static {
        departments = new HashMap<>();
        departments.put(101,new Department(101,"aaaa"));
        departments.put(102,new Department(102,"bbbb"));
        departments.put(103,new Department(103,"cccc"));
        departments.put(104,new Department(104,"dddd"));
        departments.put(105,new Department(105,"eeee"));
    }

    public Collection<Department> getAll(){
        return departments.values();
    }

    public Department getById(Integer id) {
        return departments.get(id);
    }
}
